package com.privacy.accountmgr

import android.content.Intent
import android.os.Bundle
import android.view.View
import android.view.WindowManager
import android.widget.TextView

import androidx.appcompat.app.AppCompatActivity
import com.privacy.accountmgr.R
import com.privacy.accountmgr.utils.PreferenceHelper


class SplashActivity : AppCompatActivity(), View.OnClickListener {
    private var btn_agree: TextView? = null
    private var privacy_text_tv: TextView? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        this.window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN)
        setContentView(R.layout.activity_welcome_new)
        
        initViews()
        initStatus()
        initEvents()
        waitForLocation()
    }

    private fun waitForLocation() {
        btn_agree!!.visibility = View.VISIBLE
    }

    private fun initStatus() {
        
    }

    private fun initViews() {
        btn_agree = findViewById<View>(R.id.tv_agree) as TextView
        privacy_text_tv = findViewById<View>(R.id.privacy_text_tv) as TextView
    }

    private fun initEvents() {
        btn_agree!!.setOnClickListener(this)
    }

    override fun onClick(v: View) {
        when (v.id) {
            R.id.tv_agree -> {
                PreferenceHelper.setBoolean(this, PreferenceHelper.IS_AGREED_TERMS, true)
                val it = Intent().setClass(this, LockActivity::class.java)
                startActivity(it)
                this.finish()
            }
        }
    }

}
